<template>
  <div>
    <div class="c-flex-column c-aligni-center c-pv30">
      <div class="c-ww210 c-hh180 c-mt80">
        <img :src="require('@/assets/activity_defult.png')">
      </div>
      <div class="c-fs28 c-fc-gray c-mt30">您所查看的内容已被商家{{tipInfo == 0 ? "下架": "删除"}}</div>
      <div class="c-fs28 c-fc-gray c-mt10">若有疑问，请联系商家！</div>
      <div class="c-fs28 theme-fc c-mt30 c-pb20">{{lastTime}}s后返回首页</div>
    </div>
  </div>
</template>

<script>
import { utilJs } from "@/utils/common";
export default {
  name: 'ResourceDeletion',
  components: {

  },
  props: [],
  beforeCreate() {

  },
  data() {
    return {
      theme: localStorage.getItem("colorName") ? localStorage.getItem("colorName") : "mb5_default",
      lastTime: 0,
      tInterval: null,
      tipInfo: "", //0 下架 1删除
    }
  },
  created() {
    utilJs.appShare(this);
  },
  mounted() {

  },
  computed: {

  },
  watch: {

  },
  methods: {
    //分享
    wechatShare: function () {
      let title = window.localStorage.getItem("shareTitle");
      let shareImg = window.localStorage.getItem("shareLogo");
      let shareUrl =
        window.location.href.split("#")[0] +
        "#/?refereeId=" +
        localStorage.getItem("userId");
      let shareDesc = window.localStorage.getItem("shareDesc");
      utilJs.wechatConfig(shareUrl, title, shareImg, shareDesc, function () { });
    },
    //手机端分享
    appShare: function () {
      utilJs.appShareTrue("", "", "", "");
    },
  },
  activated() {
    this.tipInfo = this.$route.query.tipInfo;
    if (this.tipInfo == 1) {
      setDocumentTitle("资源已删除");// eslint-disable-line
    } else {
      setDocumentTitle("资源已下架");// eslint-disable-line
    }
    this.lastTime = 3;
    clearInterval(this.tInterval);
    let $this = this;
    this.tInterval = setInterval(function () {
      if ($this.lastTime == 0) {
        clearInterval($this.tInterval);
        $this.tInterval = null;
        $this.$routerGo($this, "push", {
          path: "/edu/eduList"
        });
      }
      $this.lastTime -= 1;
    }, 1000);
    this.wechatShare();
  },
  deactivated() {

  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
</style>
